<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="__STATIC__/index/css/center2.css">
    <link rel="stylesheet" href="__STATIC__/index/css/newgoods.css">
    <link rel="stylesheet" href="__STATIC__/index/css/quan_common.css">
    <link rel="stylesheet" href="__STATIC__/index/css/single.css">
    <link rel="stylesheet" href="__STATIC__/index/css/common.css">
    <link rel="stylesheet" href="__STATIC__/index/css/center2.css">
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css">
    <script src="__STATIC__/index/js/jquery-3.2.1.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <title>打款页面</title>
</head>

<body>
	{include file='common/heade'}
	   <div class="ext-center" style="min-height: 1000px;">
        <div class="single_center w_1200">
    		    {include file='common/left'}
            <div class="single_r_center">
                <div class="ivu-modal-header">
                    <div class="ivu-modal-header-inner">打款页面</div>
                </div>
                <div class="ivu-modal-body">
                    <form autocomplete="off" class="ivu-form ivu-form-label-right" method="post" action="{:url('make')}">
                        <!-- 身份证号 -->
                        <div class="ivu-form-item ivu-form-item-required">
                            <label class="ivu-form-item-label" style="width: 90px;">结算账号</label>
                            <div class="ivu-form-item-content" style="margin-left: 90px;">
                                <div class="w276 ivu-input-wrapper ivu-input-type">
                                    <i class="ivu-icon ivu-icon-load-c ivu-load-loop ivu-input-icon ivu-input-icon-validate"></i>
                                    <span style="padding: 10px;font-size: 1.6rem;font-weight: 900;">621000000000000</span>
                                </div>
                            </div>
                        </div>
                        <div class="ivu-form-item ivu-form-item-required">
                            <label class="ivu-form-item-label" style="width: 90px;">充值金额</label>
                            <div class="ivu-form-item-content" style="margin-left: 90px;">
                                <div class="w276 ivu-input-wrapper ivu-input-type">
                                    <i class="ivu-icon ivu-icon-load-c ivu-load-loop ivu-input-icon ivu-input-icon-validate"></i>
                                    <input autocomplete="off" spellcheck="false" type="text" placeholder="请输入您要充值的金额" name="account" class="ivu-input">
                                </div>
                            </div>
                        </div>
                        <div class="ivu-form-item ivu-form-item-required">
                            <label class="ivu-form-item-label" style="width: 90px;">充值截图</label>
                            <div class="ivu-form-item-content" style="margin-left: 90px;">
                                <div class="w276 ivu-input-wrapper ivu-input-type">
                                    <i class="ivu-icon ivu-icon-load-c ivu-load-loop ivu-input-icon ivu-input-icon-validate"></i>
                                    <div class="layui-upload">
                                        <button type="button" class="layui-btn" id="test1" style="background:#4c6cc9;font-size:12px; ">上传图片</button>
                                        <div class="layui-upload-list w276">
                                            <img class="layui-upload-img" id="demo1" style="width:100%;">
                                            <p id="demoText"></p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <input type="hidden" name="picture">
                        <style>
                            #checked_it{
                                display: flex;
                                flex-direction: row;
                                justify-content: space-around;
                            }
                            #checked_it .close_it, #checked_it .sure_it{
                                font-size: 14px;
                                padding: 5px 20px;
                                background: #4c6cc9;
                                color: #fff;
                                border-radius: 3px;
                                cursor:pointer;
                            }
                            .close_it{
                                background: #4c6cc9;
                            }
                        </style>
                        <div id="checked_it" class="w276">
                            <div class="close_it">取消</div>
                            <div class="sure_it" onclick="submitMyForm();">确定</div>
                        </div>
                    </form>
                </div>
                <div class="ivu-modal-footer">
                    <span class="dialog-footer"></span>
                </div>
            </div>
        </div>
  	</div>
    {include file='common/bottom'}
</body>
<script>
    layui.use('upload', function(){
        var upload = layui.upload;

        //执行实例
        var uploadInst = upload.render({
            elem: '#test1' //绑定元素
            ,url: '{:url("upload")}' //上传接口
            ,done: function(res){
                //上传完毕回调
                // console.log(res);
                $('#demo1').attr('src',res.data.src);
                $('input[name="picture"]').val(res.data.src);
            }
            ,error: function(){
                //请求异常回调
            }
        });
    });

    function submitMyForm() {
        var account = $('input[name="account"]').val();
        // alert(account);
        var layer = layui.layer;
        if(!account){
            layer.msg('请输入打款金额', {icon: 2,time:1500,shade: 0.1});return false;
        }
        var picture = $('input[name="picture"]').val();
        if(!picture){
            layer.msg('请上传打款截图', {icon: 2,time:1500,shade: 0.1});return false;
        }
        $.post('{:url("make")}',{'account':account,'picture':picture},function(data){
            console.log(data);
            if(data.code == 1){
                layer.msg(data.msg, {icon: 1,time:1500,shade: 0.1},function(){
                    window.location.reload();
                });
            }else{
              layer.msg(data.msg, {icon: 2,time:1500,shade: 0.1});
            }
        },'json')
    }
</script>
</html>
